<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>WebCópias - Manutenção de Parâmetros</title>
	<link rel="shortcut icon" href="../assets/image/favicon.ico" />
	<link rel="stylesheet" href="../assets/css/styleParameter.css" />
</h:head>
<body>
	<p:growl id="resultMessage" showDetail="true" life="4000" />
	<p:layout fullPage="true" styleClass="container">
		<p:layoutUnit position="north" size="95" resizable="false" closable="false"	collapsible="false" styleClass="header">
			<ui:include src="/form/header.xhtml"></ui:include>
		</p:layoutUnit>
		<p:layoutUnit position="west" size="200" header="Navegação" collapsible="true"	styleClass="menu" style="padding:0 !important;">
			<ui:include src="/form/menu.xhtml"></ui:include>
		</p:layoutUnit>
		<p:layoutUnit position="center" header="Manutenção de Parâmetros" styleClass="content">
			<h:form id="formParameter">
				<h:panelGrid id="infosLivro" columns="2" style="margin-bottom:10px">
					<h:outputLabel for="editSMTP" value="Servidor SMTP:" styleClass="outputLabel"/>
					<p:inputText styleClass="inputText" value="#{parameter.parameter.smtpServer}" id="editSMTP" size="30"/>	

					<h:outputLabel for="editVolume" value="Diretório de arquivos:" styleClass="outputLabel"/>
					<p:inputText styleClass="inputText" value="#{parameter.parameter.volume}" id="editVolume" size="50"/>
				
					<f:facet name="footer">
						<p:commandButton id="btUpdateParameter" styleClass="updateParameterButton" actionListener="#{parameter.updateService}" update=":resultMessage" value="Atualizar" icon="ui-icon-refresh"/>
					</f:facet>
				</h:panelGrid>
			</h:form>
		</p:layoutUnit>
	</p:layout>
	<p:dialog header="Alterar Conta" widgetVar="updateAccount" resizable="false" modal="true" showEffect="slide" width="500">
		<h:form prependId="false">
			<h:panelGrid id="infosLivro" columns="2" style="margin-bottom:10px">
				<h:outputLabel for="updateRegistration" value="Matrícula:" />
				<p:inputText value="#{user.loggedUser.registration}" id="updateRegistration" disabled="true" />

				<h:outputLabel for="updateName" value="Nome:" />
				<p:inputText value="#{user.loggedUser.name}" id="updateName" />

				<h:outputLabel for="updatePassword" value="Senha:" />
				<h:inputSecret value="#{user.loggedUser.password}" id="updatePassword" styleClass="ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all ui-state-hover" />

				<h:outputLabel for="updateEmail" value="E-mail:" />
				<p:inputText value="#{user.loggedUser.email}" id="updateEmail" required="false" />

				<h:outputLabel for="updatePhoto" value="Foto:" />
				<p:inputText value="#{user.loggedUser.photo}" id="updatePhoto" required="false" />
				
				<f:facet name="footer">
					<p:separator/>
					<p:commandButton oncomplete="updateAccount.hide()" actionListener="#{user.selfUpdateUser}" update=":resultMessage" value="Salvar"/>
				</f:facet>
			</h:panelGrid>
		</h:form>
	</p:dialog>
</body>
</html>